package com.xgf.note;

import java.lang.reflect.Method;

public class AnnotationParse {
	public static String getPrivilege(Class targetClass,String methodName) throws NoSuchMethodException, SecurityException{
		Method method = targetClass.getMethod(methodName);
		String methodAccess="";
		if(method.isAnnotationPresent(PrivilegeInfo.class)){
			PrivilegeInfo annotation = method.getAnnotation(PrivilegeInfo.class);
			methodAccess = annotation.name();
		}
		return methodAccess;
	}
}
